﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

using SharedGenomics.Domain;

namespace SharedGenomics.Annotations
{
    [Serializable]
    public class PublicationsAnnotation : IAnnotation
    {
        private List<Publication> _publications;

        public PublicationsAnnotation(IEnumerable<Publication> publications)
        {
            this._publications = new List<Publication>();
            this._publications.AddRange(publications ?? Enumerable.Empty<Publication>());
        }

        public IList<Publication> Publications
        {
            get { return new ReadOnlyCollection<Publication>(this._publications); }
        }

        public AnnotationKey AnnotationKey
        {
            get { return AnnotationKey.Publications; }
        }

        public string Description
        {
            get { return String.Format("Publications ({0})", Publications.Count); }
        }

        public string EncodedKey
        {
            get
            {
                return "<annotation type=\"Publications\"></annotation>"; // TODO: What data?
            }
        }
    }
}
